package com.zhuss.controller.core;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.core.banner.wechat.ListByTypeBo;
import com.zhuss.common.BaseController;
import com.zhuss.core.banner.BannerReadServiceWechat;
import com.zhuss.enums.BannerType;
import com.zhuss.enums.EnumUtil;
import com.zhuss.exception.WpsException;


/**
 * wechat
 * banner查询 controller
 * @Author zhushanshuo
   @Date 2020-04-22 22:58
 *
 */
  
 
@RestController
@RequestMapping("/banner")
public class BannerReadController extends BaseController {
	
	@Autowired
	@Qualifier("bannerReadServiceWechat")
	private BannerReadServiceWechat bannerReadServiceWechat;
	
	
	/**
	 * 获取banner类型
	 * @return
	 * @throws WpsException
	 */
	@ResponseBody
	@RequestMapping("/bannerTypeList")
	public Object bannerTypeList() throws WpsException {
		return EnumUtil.listSelect(BannerType.class);
	}

	
	/**
	 * wechat
	 * 列表
	 * @param bo
	 * @return
	 * @throws WpsException
	 */
	@ResponseBody
    @RequestMapping("/listByType")
    public Object listByType(@RequestBody ListByTypeBo bo) throws WpsException {
		
		Object result = bannerReadServiceWechat.listByType(bo);
		return result;
    }
	

	
}
